<body>
	<div id="container">

		<ul id="menu">
			<li><a href="#overview">Overview</a></li>
			<li><a href="#qualificationRules">Qualify</a></li>
			<li><a href="#raceResults">Race</a></li>
			<li><a href="#raceLeaders">Leaders</a></li>
			<li><a href="#fastestLaps">Fastest Laps</a></li>
			<li><a href="#highestClimbers">Highest Climbers</a></li>
			<li><a href="#laptimeConsistency">Consistency</a></li>
			<li><a href="#raceHistoryGraph">History Graph</a></li>
			<li><a href="#lapByLapGraph">Lap by Lap Graph</a></li>
			<li><a href="#raceIncidents">Incidents &amp; chat</a></li>
			<li><a id="supportLink" href="#support">Support</a></li>
		</ul>


		<div id="overview" class="section">
			<h2>Overview</h2>
			<table class='overview'>
				<tr><th class='overview1'>Server Name:</th>	<td class='overview2'>{$serverName}</td><td rowspan='12'>{$trackmap}</td></tr>
				<tr><th class='overview1'>Date:</th> <td class='overview2'>{$date}</td></tr>
				<tr><th class='overview1'>Track:</th> <td class='overview2'>{$track} <em>({$distance} metres)</em></td></tr>
				<tr><th class='overview1'>Mod:</th> <td class='overview2'>{$mod}</td></tr>
				<tr><th class='overview1'>Laps:</th> <td class='overview2'>{$laps}</td></tr>
				<tr><th class='overview1'>Time:</th> <td class='overview2'>{$time}</td></tr>
				<tr><th class='overview1'>Pole:</th> <td class='overview2'>{$poledriver} <em>({$poletime})</em></td></tr>
				<tr><th class='overview1'>Winner:</th> <td class='overview2'>{$winnerdriver} <em>({$winnertime})</em></td></tr>
				<tr><th class='overview1'>Fastest lap:</th> <td class='overview2'>{$fastestlapdriver} <em>({$fastestlaptime})</em></td></tr>
				<tr><th class='overview1'>Most laps led:</th> <td class='overview2'>{$mostlapsleddriver} <em>({$mostlapsledlaps} laps)</em></td></tr>
				<tr><th class='overview1'>Highest Climber:</th> <td class='overview2'>{$highestclimber} <em>({$highestclimberposition} position(s) won)</em></td></tr>
               <tr><th class="overview1">Please Donate:</td><td class='overview2'>Any donation is greatly appreciated !
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
				<div>
					<input type="hidden" class="hidden" name="cmd" value="_xclick" />
					<input type="hidden" class="hidden" name="business" value="frank.wynants@gmail.com" />
					<input type="hidden" class="hidden" name="no_shipping" value="2" />
					<input type="hidden" class="hidden" name="no_note" value="1" />
					<input type="hidden" class="hidden" name="currency_code" value="EUR" />
					<input type="hidden" class="hidden" name="tax" value="0" />
					<input type="hidden" class="hidden" name="lc" value="BE" />
					<input type="hidden" class="hidden" name="bn" value="PP-DonationsBF" />
					<input type="image" src="https://www.paypal.com/nl_NL/i/btn/x-click-but04.gif" name="submit" alt="Betalingen verrichten met PayPal is snel, gratis en veilig!" />
					<img style="width: 1px; height: 1px;" alt="" src="https://www.paypal.com/nl_NL/i/scr/pixel.gif" />
				</div>
				</form>
            </td></tr>
               
			</table>
		</div><!--overview-->


		<div id="qualificationRules" class="section">

			<h2>Qualification results - {$track} - {$serverName} </h2>

			<h3>Overview</h3>

			<table cellpadding="0" cellspacing="0">

				<tr>
					<th>Pos</th>
					<th>Driver</th>
					<th>Laptime</th>
					<th>Gap</th>
					<th>Class</th>
					<th>Car</th>
					<th>X-mass</th>
					<th>laps</th>
				</tr>

				{section name=teller loop=$qpos}
				<tr class="{cycle values="row, altrow"}">
					<td class="position">{$qpos[teller]}</td>
					<td class="driver">{$qnaam[teller]}</td>
					<td class="time">{$qlaptime[teller]}</td>
					<td class="gap">{$qgap[teller]}</td>
					<td class="carclass">{$qcarclass[teller]}</td>
					<td class="team">{$qcar[teller]}</td>
					<td>{$qpenalty[teller]} kg</td>
					<td>{$qlaps[teller]}</td>
				</tr>
				{/section}

			</table>
         
			<h4 id="qualifyLapDetail">Lap detail (ordered by qualifying positions)</h4>

			<div class="subSection">

			{section name=teller2 loop=$qdetailnaam}

			<table cellpadding="0" cellspacing="0">

				<tr>
					<th colspan="6">{$qdetailnaam[teller2]}</th>
				</tr>

				<tr>
					<th>Lap</th>
					<th>Fuel Level</th>
					<th>Sector 1</th>
					<th>Sector 2</th>
					<th>Sector 3</th>
					<th>Laptime</th>
				</tr>

				{section name=teller3 loop=$qdetaillap[teller2]}

				<tr class="{cycle values="row,altrow"}">
					<td>{$qlapnumber[teller2][teller3]}</td>
					<td>{$qfuellevel[teller2][teller3]}</td>
					<td>{$qdetails1[teller2][teller3]}</td>
					<td>{$qdetails2[teller2][teller3]}</td>
					<td>{$qdetails3[teller2][teller3]}</td>
					<td>{$qdetaillap[teller2][teller3]}</td>
				</tr>

				{/section}

			</table>
			{/section}

			</div><!--lap detail subSection-->         
		
		</div><!-- Qualification results -->


		<div id="raceResults" class="section">

			<h2>Race results - {$track} - {$serverName}</h2>

			{if $swapped eq "true"}

			<h3>Driver swaps</h3>
		
			{section name=teller2 loop=$swapnaam}   	
			<table cellpadding="0" cellspacing="0">        
				<tr>
					<th colspan="3">{$swapnaam[teller2]}</th>
				</tr>
		
				<tr>
					<td>Startlap</td>
					<td>Ending lap</td>
					<td>Driver</td>
				</tr>
		
				{section name=teller3 loop=$swapdetaildriver[teller2]}
				<tr class="{cycle values="row, altrow"}">
					<td>{$swapdetailstartlap[teller2][teller3]}</td>
					<td>{$swapdetailendlap[teller2][teller3]}</td>
					<td>{$swapdetaildriver[teller2][teller3]}</td>
				</tr>
				{/section}
				
			</table> 
			{/section}

         <table cellpadding="0" cellspacing="0">
            <tr><th colspan="2">Percentage driven</th></tr>
            <tr><th>Driver</th><th>Percentage</th></tr>
            {section name=tellerss loop=$swappercentdriver}
               <tr class="{cycle values="row, altrow"}">
                  <td>{$swappercentdriver[tellerss]}</td><td>{$swappercent[tellerss]}%</td>
               </tr>
            {/section}
         </table>	

			<p>
				<strong>Note:</strong>
				The driver who drove the last stint will be used as the &#39;main driver&#39;.<br />
				You will only find the name of the 'main driver' in the rest of this report.<br />
				However, when driverswaps occured all information is car specific and not driver specific. For example you will 
				see the name of the main driver in the fastest laps overview, but it could just as well be another driver of 
				that car that drove the fastest lap.
			</p>

			{/if}

	      <h3>Overview</h3>

	      <table cellpadding="0" cellspacing="0">

	         <tr>
	            <th>Pos</th>
					<th>Driver</th>
					<th>Total time</th>
					<th>Gap</th>
					<th>Class</th>
					<th>Car</th>
					<th>X-mass</th>
					<th>laps</th>
					<th>pitstops</th>
	         </tr>

				{section name=teller loop=$rpos}
	         <tr class="{cycle values="row, altrow"}">
	         	<td class="position">{$rpos[teller]}</td>
					<td class="driver">{$rnaam[teller]}</td>
	         	<td class="time">{$rlaptime[teller]}</td>
	         	<td class="gap">{$rgap[teller]}</td>
	         	<td class="carclass">{$rcarclass[teller]}</td>
	         	<td class="team">{$rcar[teller]}</td>
	         	<td>{$rpenalty[teller]} kg</td>
	         	<td>{$rlaps[teller]}</td>
	         	<td>{$rpit[teller]}</td>
	       	</tr>
				{/section}

			</table>

			<h4 id="raceLapDetail">Lap detail (ordered by race positions) </h4>

			<div class="raceSubSection">

				<p>Colour codes</p>
	
				<ul>
					<li class="lightgreen">Lightgreen : 0.5s or less slower then the fastest lap of the race (of every driver)</li>
					<li class="green">Green : 0.5s or less slower then players own best lap</li>
					<li class="orange">Orange : between 0.5s and 1.5s slower then players own best lap</li>
					<li class="red">Red : between 1.5s and 3.0s slower then players own best lap</li>
					<li class="darkred">Darkred : more then 3.0s slower then players own best lap</li>      
				</ul>

				{section name=teller2 loop=$rdetailnaam}

				<table cellpadding="0" cellspacing="0">
				
					<tr>
						<th colspan="6">{$rdetailnaam[teller2]}</th>
					</tr>
					
					<tr>
						<th>Lap</th>
						<th>Fuel level</th>
						<th>Sector 1</th>
						<th>Sector 2</th>
						<th>Sector 3</th>
						<th>Laptime</th>
					</tr>

					{section name=teller3 loop=$rdetaillap[teller2]}

					<tr class="{cycle values="row, altrow"}">
						<td>{$rlapnumber[teller2][teller3]}</td>
						<td>{$rfuellevel[teller2][teller3]}</td>
						<td>{$rdetails1[teller2][teller3]}</td>
						<td>{$rdetails2[teller2][teller3]}</td>
						<td>{$rdetails3[teller2][teller3]}</td>
						<td>{$rdetaillap[teller2][teller3]}</td>
					</tr>

					{/section}

				</table>

				{/section}

			</div><!--lap detail-->

		</div><!--Race Results-->


		<div id="raceIncidents" class="section">
	
			<h2>Race Incidents - {$track} - {$serverName}</h2>
	
			<h3>Number of contacts/driver</h3>
	
			<!-- <div class="subSection"> -->
	
				<table cellpadding="0" cellspacing="0">
	
				<tr>
					<th class="numIncidents">Number of incidents</th>
					<th>Driver</th>
				</tr>
	
				{section name=tteller loop=$incidentnames}

				<tr class="{cycle values="row, altrow"}">
					<td class="numIncidents">{$incidentcounter[tteller]}</td>
					<td class="driver">{$incidentnames[tteller]}</td>
				</tr>

				{/section}
	
				</table>
	
			<!-- </div> --> <!-- subSection Number of contacts/driver-->
		
			<h4 id="incidents">Complete overview of incidents</h4>
	
			<div class="subSection">
	
				<table cellpadding="0" cellspacing="0">
	
				<tr>
					<th>Time of incident</th>
					<th>Incident</th>
				</tr>
	
				{section name=incidentteller loop=$itime}

                  <tr class="{cycle values="row, altrow"}">
                 <td class="timeOfIncident">{$itime[incidentteller]}</td>
                     <td class="driverIncident">{$iincident[incidentteller]}</td>
                  </tr>

				{/section}
	
				</table>
	
			</div><!--Overview-->
            <h2>Chat - {$track} - {$serverName}</h2>
            <table cellpadding="0" cellspacing="0">
				<tr>
                  <th>Time</th>
					<th>Driver</th>
					<th>Message</th>
				</tr>
				{section name=chatcounter loop=$ichatDriver}
                  <tr class="{cycle values="row, altrow"}">
                  <td>{$ichattime[chatcounter]}</td>
                 <td>{$ichatDriver[chatcounter]}</td>
                  <td class="driverIncident">{$ichatMessage[chatcounter]}</td>
               </tr>
				{/section}
            </table>
		</div><!--race incidents-->

		<div id="raceLeaders" class="section">
	
			<h2>Race leaders - {$track} - {$serverName}</h2>
	
			<table cellpadding="0" cellspacing="0">
	
				<tr>
					<th>Driver</th>
					<th>Laps</th>
					<th class="car">Car</th>
					<th>Class</th>
					<th>Car</th>
				</tr>
	
				{section name="leaderteller loop=$raceleaderrondes}

				<tr class="{cycle values="row, altrow"}">
					<td class="driver">{$raceleadernamen[leaderteller]}</td>
					<td>{$raceleaderrondes[leaderteller]}</td>
					<td class="carclass">{$raceleadernumber[leaderteller]}</td>
					<td class="team">{$raceleadercar[leaderteller]}</td>
				</tr>

				{/section}
	
			</table>
	
		</div><!--Race Leaders -->


		<div id="fastestLaps" class="section">

			<h2>Fastest laps - {$track} - {$serverName}</h2>
		
			<h3>Total times</h3>

<!--			<div class="subSection">-->

				<table cellpadding="0" cellspacing="0">

				<tr>
					<th>Pos</th>
					<th>Driver</th>
					<th>Laptime</th>
					<th>Gap</th>
					<th>Class</th>
					<th>Car</th>
				</tr>

				{section name=teller5 loop=$fastestname}

				<tr class="{cycle values="row, altrow"}">
					<td class="position">{$fastestposition[teller5]}</td>
					<td class="driver">{$fastestname[teller5]}</td>
					<td class="time">{$fastesttime[teller5]}</td>
					<td class="gap">{$fastestgap[teller5]}</td>
					<td class="carclass">{$fastestcarclass[teller5]}</td>
					<td class="team">{$fastestcar[teller5]}</td>
				</tr>

				{/section}

				</table>
			<!--</div>--><!--Total times-->
			
			
			<h4>Best possible laptimes (combination of 3 best sectors per driver)</h4>

			<div class="subSection">

				<table cellpadding="0" cellspacing="0">

					<tr>
						<th>Pos</th>
						<th>Driver</th>
						<th>Fastest possible time</th>
						<th>Gap</th>
						<th>Class</th>
						<th>Car</th>
					</tr>

					{section name=teller20 loop=$ppos}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$ppos[teller20]}</td>
						<td class="driver">{$pdriver[teller20]}</td>
						<td class="time">{$ptime[teller20]}</td>
						<td class="gap">{$pgap[teller20]}</td>
						<td class="carclass">{$pcarclass[teller20]}</td>
						<td class="team">{$pcar[teller20]}</td>
					</tr>

					{/section}

				</table>

			</div><!--fastestpossible-->
				
			<h4 id="sector1">Sector 1</h4>

			<div class="subSection">

				<table cellpadding="0" cellspacing="0">

					<tr>	
						<th>Pos</th>
						<th>Driver</th>
						<th>Sectortime</th>
						<th>Gap</th>
						<th>Class</th>
						<th>Car</th>
					</tr>

					{section name=teller6 loop=$s1name}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$s1position[teller6]}</td>
						<td class="driver">{$s1name[teller6]}</td>
						<td class="time">{$s1time[teller6]}</td>
						<td class="gap">{$s1gap[teller6]}</td>
						<td class="carclass">{$s1carclass[teller6]}</td>
						<td class="team">{$s1car[teller6]}</td>
					</tr>

					{/section}

				</table>

			</div><!--sector 1-->
				
			<h4 id="sector2">Sector 2</h4>

			<div class="subSection">

				<table cellpadding="0" cellspacing="0">

					<tr>
						<th>Pos</th>
						<th>Driver</th>
						<th>Sectortime</th>
						<th>Gap</th>
						<th>Class</th>
						<th>Car</th>
					</tr>

					{section name=teller7 loop=$s2name}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$s2position[teller7]}</td>
						<td class="driver">{$s2name[teller7]}</td>
						<td class="time">{$s2time[teller7]}</td>
						<td class="gap">{$s2gap[teller7]}</td>
						<td class="carclass">{$s2carclass[teller7]}</td>
						<td class="team">{$s2car[teller7]}</td>
					</tr>

				{/section}

				</table>

			</div><!--sector 2-->

			<h4 id="sector3">Sector 3</h4>

			<div class="subSection">

				<table cellpadding="0" cellspacing="0">

					<tr>
						<th>Pos</th>
						<th>Driver</th>
						<th>Sectortime</th>
						<th>Gap</th>
						<th>Class</th>
						<th>Car</th>
					</tr>

					{section name=teller8 loop=$s3name}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$s3position[teller8]}</td>
						<td class="driver">{$s3name[teller8]}</td>
						<td class="time">{$s3time[teller8]}</td>
						<td class="gap">{$s3gap[teller8]}</td>
						<td class="carclass">{$s3carclass[teller8]}</td>
						<td class="team">{$s3car[teller8]}</td>
					</tr>

					{/section}

				</table>

			</div><!--sector 3-->

		</div><!--Fastest laps-->


		<div id="highestClimbers" class="section">

			<h2>Highest climbers - {$track} - {$serverName}</h2>

			<table cellpadding="0" cellspacing="0">

				<tr>
					<th>+/-</th>
					<th>Driver</th>
					<th>Start position</th>
					<th>Finish position</th>
					<th>Class</th>
					<th>Car</th>
				</tr>

				{section name=teller9 loop=$hcpositions}

				<tr class="{cycle values="row, altrow"}">
					<td class="position">{$hcpositions[teller9]}</td>
					<td class="driver">{$hcdriver[teller9]}</td>
					<td>{$hcstartposition[teller9]}</td>
					<td>{$hcfinishposition[teller9]}</td>
					<td class="carclass">{$hccarclass[teller9]}</td>
					<td class="team">{$hccar[teller9]}</td>
				</tr>

				{/section}

			</table>
		</div><!--highest climbers-->

		
		<div id="laptimeConsistency" class="section">

			<h2>Race laptime consistency - {$track} - {$serverName}</h2>
		
			<h3 id="stdDeviation">Standard Deviation</h3>

			<!-- <div class="subSection">-->

				<table cellpadding="0" cellspacing="0">

					<tr>
						<th>Pos</th>
						<th>Driver</th>
						<th>Standard Deviation</th>
						<th>Gap</th>
						<th>Class</th>
						<th>Car</th>
					</tr>

					{section name=teller10 loop=$stddevpos}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$stddevpos[teller10]}</td>
						<td class="driver">{$stddevdriver[teller10]}</td>
						<td class="time">{$stddevtime[teller10]}</td>
						<td class="gap">{$stddevgap[teller10]}</td>
						<td class="carclass">{$stddevcarclass[teller10]}</td>
						<td class="team">{$stddevcar[teller10]}</td>
					</tr>

				{/section}

				</table>

			<!-- </div> --> <!--Std Deviation-->
		
			<h3 id="avgDeviation">Average Deviation</h3>

			<!-- <div class="subSection"> -->

				<table cellpadding="0" cellspacing="0">

					<tr>
						<th>Pos</th>
						<th>Driver</th>
						<th>Average Deviation</th>
						<th>Gap</th>
						<th>Number</th>
						<th>Car</th>
					</tr>

					{section name=teller11 loop=$avgdevpos}

					<tr class="{cycle values="row, altrow"}">
						<td class="position">{$avgdevpos[teller11]}</td>
						<td class="driver">{$avgdevdriver[teller11]}</td>
						<td class="time">{$avgdevtime[teller11]}</td>
						<td class="gap">{$avgdevgap[teller11]}</td>
						<td class="carclass">{$avgdevcarclass[teller11]}</td>
						<td class="team">{$avgdevcar[teller11]}</td>
					</tr>

					{/section}

				</table>

			<!-- </div> --> <!--Avg Deviation-->
		
		</div><!--Race laptime consistency-->


		<div id="raceHistoryGraph" class="section">

			<h2>Race history graph - {$track} - {$serverName}</h2>

			<h3>(Names in legend are in order of finishing positions)</h3>

			<form action="racehistory.php">
			<div>
			
				<label for="h-startlap">Startlap:</label>
				<input type="text" id="h-startlap" name="startlap" value="0" size="5" />

				<label for="h-endlap">Endlap:</label>
				<input type="text" id="h-endlap" name="endlap" value="{$laps}" size="5" />

         	<input type="hidden" class="hidden" name="file" value="{$racefile}" />

				<input class="graphButton" type="submit" name="submit" value="Zoom racehistory graph in new window" />

			</div>
         </form>

			<img src="{$racehistorygraph}" alt="" />

		</div><!--Race history graph-->


		<div id="lapByLapGraph" class="section">

			<h2>Lap by lap graph - {$track} - {$serverName}</h2>

			<h3>(Names in legend are in order of finishing positions)</h3>
			
         <form action="lapbylap.php">
			<div>

				<label for="l-startlap">Startlap:</label>
				<input type="text" id="l-startlap" name="startlap" value="0" size="5" />
	
				<label for="l-endlap">Endlap:</label>
				<input type="text" id="l-endlap" name="endlap" value="{$laps}" size="5" />
	
	         <input type="hidden" class="hidden" name="file" value="{$racefile}" />
	
	         <input class="graphButton" type="submit" name="submit" value="Zoom lap by lap graph in new window" />

			</div>
         </form>

			<img src="{$lapbylapgraph}" alt="" />

		</div><!--lap by lap-->

		<div id="support" class="section">

			<h1>
				rFactor-report<a href="http://code.google.com/p/rfactor-report/">
			<img src="google.png" alt="Google code logo" />
				</a>
			</h1>

			<h2>Donate</h2>

				<p>If you like this program please show your appreciation by donating.</p>
				
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
				<div>
					<input type="hidden" class="hidden" name="cmd" value="_xclick" />
					<input type="hidden" class="hidden" name="business" value="frank.wynants@gmail.com" />
					<input type="hidden" class="hidden" name="no_shipping" value="2" />
					<input type="hidden" class="hidden" name="no_note" value="1" />
					<input type="hidden" class="hidden" name="currency_code" value="EUR" />
					<input type="hidden" class="hidden" name="tax" value="0" />
					<input type="hidden" class="hidden" name="lc" value="BE" />
					<input type="hidden" class="hidden" name="bn" value="PP-DonationsBF" />
					<input type="image" src="https://www.paypal.com/nl_NL/i/btn/x-click-but04.gif" name="submit" alt="Betalingen verrichten met PayPal is snel, gratis en veilig!" />
					<img style="width: 1px; height: 1px;" alt="" src="https://www.paypal.com/nl_NL/i/scr/pixel.gif" />
				</div>
				</form>
			
			<ul>
				<li><a href="http://users.pandora.be/riptor">Knarf&#39;s homepage</a></li>
				<li><a href="http://www.vrl-simracing.be/rfactorreport/">rFactor report homepage</a></li>
			</ul>

			<p>
				If you find any problems in this report please send an email to <a href="mailto:frank.wynants@gmail.com">frank.wynants@gmail.com</a>.
				I will look into the problem as soon as possible.
			</p>

			<h2>Tiny URL</h2>
	
			<form action="http://tinyurl.com/create.php" method="post">
			<div>
	
				<label for="url">URL</label>
				<input type="text" id="url" name="url" value="{$url}" size="80" />
	
				<input type="submit" name="submit" value="Make TinyURL!" />

			</div>
			</form>
           <h2>About</h2>
           <p>
            <i>PHP Coding</i> : Frank Wynants
           </p>
           <p>
           <i>Layout</i> : Jeff Carriere
           </p>

		</div><!--support-->

		
	</div><!--container-->


</body>
</html>
